<?php

error_reporting(0);

define('FSDKP', TRUE);

require_once('../_init_.php');

function checkAdminLogin() {
  if(!isset($_SESSION[AUTH.'_admin'])) {
    redirect(WEB_URL.'/login.php','','',1);
  }
}

function request($val) {
  return preg_replace("/([^A-Za-z0-9_\-])+/",'',strtolower($val));
}

function getTips() {
  $tips = '';
  switch($_REQUEST['r']) {
  case 'addok':
    $tips = 'showTip("添加成功",null,2);';
    break;
  case 'editok':
    $tips = 'showTip("修改完成",null,2);';
    break;
  case 'recycleok':
    $tips = 'showTip("删除成功",null,2);';
    break;
  case 'deleteok':
    $tips = 'showTip("已成功删除",null,2);';
    break;
  case 'recoverok':
    $tips = 'showTip("恢复成功",null,2);';
    break;
  case 'title':
    $tips = 'showTip("标题不能为空",null,2);';
    break;
  case 'same':
    $tips = 'showTip("重复的记录",null,2);';
    break;
  case 'self':
    $tips = 'showTip("无法归类自己",null,2);';
    break;
  case 'ok':
    $tips = 'showTip("操作成功",null,2);';
    break;
  case 'error':
    $tips = 'showTip("出错拉",null,2);';
    break;
  case 'empty':
    $tips = 'showTip("信息不完整",null,2);';
    break;
  }
  return $tips;
}


?>